<template>
 <div class="social-container">
    <div class="box"
         @click="handleClick('wechat')">
      <span class="container"
            :style="{backgroundColor:'#6ba2d6'}">
        <i icon-class="wechat"
           class="iconfont icon-weixin"></i>
      </span>
      <p class="title">微信</p>
    </div>
    <div class="box"
         @click="handleClick('gitee')">
      <span class="container"
            :style="{backgroundColor:'rgb(191, 48, 48)'}">
        <i icon-class="qq"
           class="iconfont icon-logo_gitee_icon"></i>
      </span>
      <p class="title">gitee</p>
    </div>
    <div class="box"
         @click="handleClick('oschina')">
      <span class="container"
            :style="{backgroundColor:'rgb(0, 123, 37)'}">
        <i icon-class="qq"
           class="iconfont icon-OSChina_logo_"></i>
      </span>
      <p class="title">gitee</p>
    </div>
    <div class="box"
         @click="handleClick('qq')">
      <span class="container"
            :style="{backgroundColor:'#8dc349'}">
        <i icon-class="qq"
           class="iconfont icon-qq1"></i>
      </span>
      <p class="title">QQ</p>
    </div>
  </div>
</template>

<script>
import { randomLenNum,openWindow } from "@/util/util";
import { mapGetters } from "vuex";

export default {
  name: 'thirdLogin',
  methods: {
    handleClick (thirdpart) {
      let appid, client_id, redirect_uri, url;
      redirect_uri = encodeURIComponent(window.location.origin + '/#/authredirect');
      url = 'http://127.0.0.1:8443/oauth/render/'+thirdpart;
      openWindow(url, thirdpart, 540, 540)
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.social-container {
  margin: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  .box {
    cursor: pointer;
  }
  .iconfont {
    color: #fff;
    font-size: 30px;
  }
  .container {
    $height: 50px;
    display: inline-block;
    width: $height;
    height: $height;
    line-height: $height;
    text-align: center;
    border-radius: 4px;
    margin-bottom: 10px;
  }
  .title {
    text-align: center;
  }
}
</style>